package com.alpha.processor.creators.interface_file;

import com.alpha.processor.processor.tools.ProcessorTool;
import com.alpha.processor.creators.base.CreateModel;

import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.util.Elements;

public class ProviderInterfaceCreateModel extends CreateModel {

    public static final String InterfaceFileEndName = "_Interface";

    public static final String ProvideViewMethodName = "provideTargetView";
    public static final String ProvideProcessorMethodName = "provideTargetProcessor";

    private TypeElement viewClassElement;
    private VariableElement viewParamElement;

    private TypeElement processorClassElement;
    private VariableElement processorParamElement;

    public ProviderInterfaceCreateModel(ProcessorTool logger, Elements elementUtils, TypeElement classElement) {
        super(logger, elementUtils, classElement);
    }

    public void updateClassElement(TypeElement viewClassElement,TypeElement processorClassElement){
        this.viewClassElement = viewClassElement;
        this.processorClassElement = processorClassElement;
    }

    public void updateParamElement(VariableElement viewParamElement,VariableElement processorParamElement){
        this.viewParamElement = viewParamElement;
        this.processorParamElement = processorParamElement;
    }

    @Override
    public String getGenarateFileName() {
        return getClassName() + InterfaceFileEndName;
    }

    public TypeElement getViewClassElement() {
        return viewClassElement;
    }

    public TypeElement getProcessorClassElement() {
        return processorClassElement;
    }

    public VariableElement getViewParamElement() {
        return viewParamElement;
    }

    public VariableElement getProcessorParamElement() {
        return processorParamElement;
    }
}
